{% extends 'base.html' %}
{% load humanize %}

{% block extra_head %}
<title>{{category.name}}</title>
<style type='text/css'>
    .archive .info{
        color:gray;
    }
    .archive .para{
        margin:5px 0 1.5em 2em;
    }
</style>
{% endblock %}

{% block content %}
<h2>{{category.name}} -- 文章列表</h2>
{% for archive in archives %}
<div class='archive'>
    <h4><a href='{{archive.get_absolute_url}}'>{{archive.title}}</a></h4>
    <div class='info'>
        {{archive.pub_date|naturalday}} {{archive.pub_date|date:"H:i"}}
    </div>
    {% autoescape off %}
    {% spaceless %}
    <div class='para'>{{archive.content|striptags|slice:":200"}}</div>
    {% endspaceless %}
    {% autoescape on %}
    {% endautoescape %}
    {% endautoescape %}

</div><!-- .archive -->

{% endfor %}
{% if env_is_admin %}
<a href='/category/{{category.name}}/edit'>修改此分类</a>
<a href='/archive'>发表新文章</a>
<a href='/category'>新建一个分类</a>
{% endif %}
{% endblock %}

